package com.hmily.dubbo.consumer.sync;

import com.hmily.dubbo.api.LongTimeQueryFacade;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;

/**
 * <h1>调用失败时的容错设置, 启动类。</h1>
 *
 * @author hmilyylimh
 *         ^_^
 * @version 0.0.1
 *         ^_^
 * @date 2021-10-21
 *
 */
public class XmlBroadcastConsumerApplication {

    public static void main(String[] args) throws IOException {
        String configPath = "classpath*:META-INF/spring/cluster_broadcast_consumer.xml";
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(configPath);
        ctx.refresh();

        // 接口调用
        LongTimeQueryFacade longTimeQueryFacade = ctx.getBean(LongTimeQueryFacade.class);
        System.out.println(longTimeQueryFacade.queryUser("hmily"));


        // 阻塞等待
        System.in.read();
    }
}
